<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <#include "/header.html">
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="twbGoodsListModel.stepOne">
        <el-row style="margin:10px;">
            <form class="form-inline" role="form">
                <div class="form-group" style="margin-right:10px;">
                    <lable>商品状态:</lable>
                </div>
                <div class="form-group">
                    <el-radio class="form-group" v-model="q.marketable" size="mini" border label="">全部</el-radio>
                    <el-radio class="form-group" v-model="q.marketable" size="mini" border label="puton">上架</el-radio>
                    <el-radio class="form-group" v-model="q.marketable" size="mini" border label="pulloff">下架</el-radio>
                    <el-radio class="form-group" v-model="q.marketable" size="mini" border label="delete">删除</el-radio>
                </div>
            </form>
        </el-row>
        <el-row style="margin:10px;">
            <lable style="margin-right:10px;"> 操作:</lable>
            <el-button type="primary" size="mini" @click="listOperation('delete')" plain>删除</el-button>
            <el-button type="primary" size="mini" @click="listOperation('puton')" plain>上架</el-button>
            <el-button type="primary" size="mini" @click="listOperation('pulloff')" plain>下架</el-button>
        </el-row>
        <el-row>
            <el-table border :data="twbGoodsList"
                      highlight-current-row
                      header-row-class-name="tableHead"
                      :row-class-name="tableRowClassName"
                      ref="twbGoodsListRef"
                      size="small" style="width: 100%">
                <el-table-column type="selection" width="55"></el-table-column>
                <el-table-column prop="goodsId" align="center" label="商品id" width="100"></el-table-column>
                <el-table-column prop="name" align="center" label="商品名称" width="180">
                    <template slot-scope="scope">
                        <a @click="jumpZiyun(scope.row.goodsId)">{{scope.row.name}}</a>
                    </template>
                </el-table-column>
                <el-table-column label="商品详情" align="center" >
                    <template slot-scope="scope">
                        <form class="form-inline">
                            <div class="form-group" style="float: left;margin-left: 20px;">
                                <img class="form-inline" style="height: 80px;" :src="'https://ziyunoss.oss-cn-hangzhou.aliyuncs.com/'+scope.row.imageUrl" />
                            </div>
                            <div class="form-group" style="float: left;text-align:center;line-height:80px;margin-left: 30px;">
                                <span class="form-inline">{{scope.row.brief}}</span>
                            </div>
                        </form>
                    </template>
                </el-table-column>
                <el-table-column  align="center" label="上下架状态" width="100">
                    <template slot-scope="scope">
                        <span v-if="scope.row.marketable == 'puton'">上架</span>
                        <span v-if="scope.row.marketable == 'pulloff'">下架</span>
                        <span v-if="scope.row.marketable == 'delete'">删除</span>
                    </template>
                </el-table-column>
                <el-table-column prop="totalPrice" align="center" label="价格" width="250">
                    <template slot-scope="scope">
                        <span>{{scope.row.minPrice}} - {{scope.row.maxPrice}}</span>
                        <a @click="editPrice(scope.row.goodsId)"  style="margin-left:10px;" >修改价格</a>
                    </template>
                </el-table-column>
                <el-table-column prop="countTotal" align="center" label="总销售量" width="100"></el-table-column>
                <el-table-column prop="createTime" align="center" label="发布时间" width="200"></el-table-column>
                <el-table-column  label="操作" align="center" width="100">
                    <template slot-scope="scope">
                        <a  @click="detailGoods(scope.row.goodsId,scope.row.twbPushFlag)" >详情</a>
                    </template>
                </el-table-column>
            </el-table>
            <div class="block text-right">
                <el-pagination
                        @size-change="handleSizeChange"
                        @current-change="handleCurrentChange"
                        :current-page="1"
                        :page-sizes="[page.size, 2*page.size, 4*page.size]"
                        :page-size="page.pageSize"
                        :total="page.total">
                </el-pagination>
            </div>
        </el-row>
    </div>
    <div v-show="!twbGoodsListModel.stepOne">
        <zy-goods-push
            ref="zyPushGoods"
            @zy-push-goods-click="pushGoodsClick">
            发布商品组件
        </zy-goods-push>
    </div>
    <el-dialog width="50%" title="价格修改" :visible.sync="dialogs.editPriceDialog">
        <el-table :data="twbEditPriceVoList" size="small" border header-row-class-name="tableHead" style="width: 100%">
            <el-table-column align="center" align="center" v-for="(columnName,index) in columnNames" :label="columnName">
                <template slot-scope="scope">
                    <!--<el-input placeholder="请输入库存数量" v-model="scope.row.spec" clearable></el-input>-->
                    <span>{{scope.row.goodsOptionEntityList[index].optionName}}</span>
                </template>
            </el-table-column>
            <el-table-column  align="center" label="重量" width="180" >
                <template slot-scope="scope">
                    <el-input type="number" min="0" clearable v-model="scope.row.weight" />
                </template>
            </el-table-column>
            <el-table-column  align="center" label="销售价格" width="180" :render-header="renderHeader">
                <template slot-scope="scope">
                    <el-input type="number" min="0" clearable v-model="scope.row.totalPrice" />
                </template>
            </el-table-column>
            <el-table-column  align="center" label="成本价格" width="180" :render-header="renderHeader">
                <template slot-scope="scope">
                    <el-input type="number" min="0" clearable v-model="scope.row.cost"/>
                </template>
            </el-table-column>
        </el-table>
        <div slot="footer" class="dialog-footer">
            <el-button type="primary" @click="saveEditPrice" >确定</el-button>
            <el-button type="primary" @click="resetEditPrice">取消</el-button>
        </div>
    </el-dialog>

</div>
<script src="${request.contextPath}/statics/js/modules/freightages/freighttemplateCompent.js?_${.now?long}"></script>
<script src="${request.contextPath}/statics/js/modules/twbGoods/twbGoodsPushComponent.js?_${.now?long}"></script>
<script src="${request.contextPath}/statics/js/modules/twbGoods/twbGoodsList.js?_${.now?long}"></script>
<script src="${request.contextPath}/statics/js/modules/goodsCraftPrice/goodsCraftPriceComponent.js?_${.now?long}"></script>

<style>
    /*.tableHead {*/
        /*font-size: large;*/
        /*color:black;*/
    /*}*/
    .el-table .warning-row {
        background: oldlace;
    }
    .el-table .success-row {
        background: #f0f9eb;
    }
</style>
</body>
</html>